home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpdb314.zip / TPDB.DOC < prev    next >
Text File  |  1991-01-31  |  55KB  |  1,924 lines

  1. This  documentation   was  written  using   Borland's  MicroStar  word
  2. processor.
  3.  
  4. THIS  SOFTWARE IS  PROTECTED BY  A COPYRIGHT  DULY REGISTERED WITH THE
  5. U.S. COPYRIGHT OFFICE. PIRACY WILL NOT  GO UNPUNISHED (IN THIS LIFE OR
  6. THE NEXT.)
  7.  
  8.                      (****************************************)
  9.                      (*               TPDB 3.14              *)
  10.                      (*     Turbo Pascal Tools for dBASE     *)
  11.                      (*                                      *)
  12.                      (*           Turbo Pascal 6.0           *)
  13.                      (*  Object - Oriented Database Toolbox  *)
  14.                      (*    Utilizing dBASE Compatible Data   *)
  15.                      (*                Files                 *)
  16.                      (*                                      *)
  17.                      (*            Copyright 1990            *)
  18.                      (*               Brian Corll            *)
  19.                      (*      and Ten B.C. Micro Systems      *)
  20.                      (*          All Rights Reserved         *)
  21.                      (*      dBASE, dBASE III, and dBASE     *)
  22.                      (*      III Plus are registered         *)
  23.                      (*    trademarks of Ashton-Tate Corp.   *)
  24.                      (*                                      *)
  25.                      (*    Turbo Pascal is a registered      *)
  26.                      (*    trademark of Borland Int. Corp.   *)
  27.                      (*                                      *)
  28.                      (*     Version 3.14  January,1991       *)
  29.                      (*                                      *)
  30.                      (****************************************)
  31.                      (*     Portions copyright 1984,1990 by  *)
  32.                      (*       Borland International Corp.    *)
  33.                      (****************************************)
  34.  
  35.  
  36.             TPDB is  a toolbox of  Turbo Pascal 6.0  units which allow
  37.             you  to access,  index,  search,  read and  write database
  38.             files that were created with  dBASE III or III Plus, using
  39.             75+   Turbo  Pascal   procedures  and   functions  written
  40.             specifically   for   these   purposes,   and  implementing
  41.             object-oriented techniques. This toolbox supports multiple
  42.             data  files  and  associated   indexes (NOT dBASE INDEXES !)
  43.             limited only by available  memory and file handles allowed
  44.             by DOS. Index keys can be up to 254 characters, and can be
  45.             composed of multiple fields  or expressions which evaluate
  46.             to a string not longer than 254 characters.
  47.  
  48.            ************************************************************
  49.            *                   Technical Support                      *
  50.            ************************************************************
  51.            *                                                          *
  52.            *Questions/comments can be left for  me on the InterLink or*
  53.            *FidoNet Pascal  or dBASE conferences.  On FidoNet, I  am a*
  54.            *point, 1:270/111.3                                        *
  55.            *                                                          *
  56.            ************************************************************
  57.            *My CompuServe ID is 73067,3310.                           *
  58.            ************************************************************
  59.  
  60.             This  program  is  being  distributed  under the Shareware
  61.             concept.
  62.  
  63.             If you like this program and use it, a registration fee of
  64.             $ 19.95 is required for non-profit users. Commercial users
  65.             MUST  register for  a one-time,  royalty-free registration
  66.             fee of $ 29.95. Registered  users will receive source code
  67.             for TPDB.tpu, TPDBDATE.tpu, TPDBScrn.tpu, TPDBStr.tpu, and
  68.             TPDBSort.tpu. See the file REGISTER.FRM. Registration also
  69.             includes free technical support, within the limitations of
  70.             my time and resources.
  71.  
  72.             NOTA BENE:  This registration fee is  intended to cover my
  73.             personal  time  and  expense  in  developing, documenting,
  74.             distributing,  and supporting  this toolbox,  and does not
  75.             constitute the sale of the code contained therein.
  76.  
  77.  
  78.             Write to:
  79.  
  80.                          SoftIron
  81.                          Brian Corll
  82.                          1002 East Simpson Street
  83.                          Mechanicsburg,PA  17055
  84.  
  85.             Make checks payable to Brian Corll.
  86.  
  87.             DISCLAIMER
  88.  
  89.             This program  is provided "as is"  without warranty of any
  90.             kind, either express or  implied, included but not limited
  91.             to the implied warranty of merchantability and fitness for
  92.             a specific purpose. The entire  risk as to the quality and
  93.             performance of this program is with you.
  94.  
  95.             In  no event  will the  author be  liable to  you for  any
  96.             damages, including any lost profits, lost savings or other
  97.             incidental or consequential damages arising out of the use
  98.             of or inability to use this program.
  99.  
  100.             That said, please  be assured that I have  spent many long
  101.             hours trying to make this toolbox  the best it can be, and
  102.             I'm working to make it even better !
  103.  
  104. (**********************************)
  105. (* Interface Listing for TPDB.pas *)
  106. (**********************************)
  107.  
  108.  
  109. Unit TPDB;
  110.  
  111. {This version is Version 3.14 January, 1991}
  112.  
  113.  
  114.                      (***********************************)
  115.                      (*         Object -Oriented        *)
  116.                      (*     Turbo Pascal 6.0 Unit       *)
  117.                      (*    for Accessing dBASE III      *)
  118.                      (*             files.              *)
  119.                      (*        Copyright 1990           *)
  120.                      (*          Brian Corll            *)
  121.                      (*       All Rights Reserved       *)
  122.                      (*     dBASE is a registered       *)
  123.                      (* trademark of Ashton-Tate, Inc.  *)
  124.                      (*   Version 3.14 January,1991     *)
  125.                      (***********************************)
  126.                      (*   Portions Copyright 1984,1990  *)
  127.                      (*    Borland International Corp.  *)
  128.                      (***********************************)
  129.  
  130.  
  131. INTERFACE
  132.  
  133. Uses CRT,Dos,TPDBINDX,TPDBDate,TPDBScrn,TPDBStr;
  134.  
  135.  
  136. (******************************)
  137. (*      Global VARiables      *)
  138. (******************************)
  139.  
  140. CONST
  141.  
  142.   (**************************************************************************)
  143.    MaxInds = 10; {Maximum number of indexes per file.  Change this as needed.}
  144.   (**************************************************************************)
  145.  
  146.   AutoWrap    : Boolean = FALSE;
  147.   {Set this to TRUE to enable wrapping of field input.}
  148.  
  149.   { These are screen editing control keys:
  150.   CursorDown  = ^X;
  151.   CursorEND   = ^F;
  152.   CursorHome  = ^A;
  153.   CursorLeft  = ^S;
  154.   CursorRight = ^D;
  155.   CursorUp    = ^E;
  156.   DelKey      = ^G;
  157.   Escape      = ^[;
  158.   ExtKey       : Boolean = FALSE;
  159.   PageDown     = ^C;
  160.   PageUp       = ^R;
  161.   Return       = ^M;
  162.   TabKey       = #9;}
  163.  
  164.   { These constants determine whether or not index keys are unique:
  165.   NoDuplicates = 0;
  166.   Duplicates  =  1;}
  167.  
  168.   Filler  :  Char  =  #32;  {This  is  the character displayed for blank
  169.   portion of fields during editing and display.}
  170.  
  171.   {Numeric processing minimum and maximum values
  172.   MaxLong      = 2147483647;
  173.   MaxReal      = 3.4E37;
  174.   MinLong      = -2147483647;
  175.   MinReal      = 1.5E-45;}
  176.  
  177.  
  178.  
  179.   UpperCase  : Boolean  = FALSE;  {Turns upper  case conversion ON/OFF
  180.   during screen input.}
  181.  
  182.   {Date format constants}
  183.   {Used by SetDateFormat procedure}
  184.   French   = 1; {dd/mm/yy}
  185.   German   = 2; {dd.mm.yy}
  186.   Italian  = 3; {dd-mm-yy}
  187.   American = 4; {mm/dd/yy}
  188.   British  = 5; {dd/mm/yy}
  189.   Ansi     = 99;{yy.mm.dd}
  190.  
  191.  
  192.  
  193. Type
  194.   Str2     = String[2];
  195.   Str4     = String[4];
  196.   Str5     = String[5];
  197.   Str6     = String[6];
  198.   Str8     = String[8];
  199.   Str10    = String[10];
  200.   Str15    = String[15];
  201.   Str20    = String[20];
  202.   Str30    = String[30];
  203.   Str60    = String[60];
  204.   Str80    = String[80];
  205.   Str132   = String[132];
  206.   Str254   = String[254];
  207.   CharSet  = Set of Char;
  208.   ByteSet  = Set of Byte;
  209.  
  210.   FileName = String[66];
  211.   DBRecPtr = ^DBType;
  212.   DBType   = Array[1..4000] of Char;  (* dBASE record buffer *)
  213.  
  214.           DBHeader = RECORD  (* dBASE file header *)
  215.           DBType    : Byte;
  216.           Year      : Byte;
  217.           Month     : Byte;
  218.           Day       : Byte;
  219.           RecCount  : LongInt;
  220.           Location  : Integer;
  221.           RecordLen : Integer;
  222.           Reserved  : Array[1..20] of Byte;
  223.           Terminator : Char;
  224.           END;
  225.  
  226.           DBField = Record (* DBF field descriptors *)
  227.           FieldName    : Array[1..11] of Char;
  228.           FieldType    : Byte;
  229.           FieldAddress : LongInt;
  230.           FieldLen     : Byte;
  231.           FieldDec     : Byte;
  232.           Reserved     : Array[1..14] of Char;
  233.           END;
  234.  
  235.           HeadPtr = ^DBHeader;
  236.           PosPtr = ^DBEditArray;
  237.           FieldPtr = ^FieldArray;
  238.           DBEditArray = Array[1..2,1..128] of Integer;
  239.           FieldArray  = Array[1..128] of DBField;
  240.  
  241.           DBIndex = RECORD  (* Index file control  record *)
  242.           Ndx : IndexFile;
  243.           NdxID : BYTE;
  244.           NdxName : FileName;
  245.           Open : BOOLEAN;
  246.           END;
  247.  
  248.           NdxArray = ARRAY[1..MaxInds] OF DBIndex;
  249.           NdxPtr = ^NdxArray;
  250.  
  251. (*****************************************************************************)
  252. (*             Database File Object Declaration                              *)
  253. (*****************************************************************************)
  254.  
  255.    DataObject = ^DBF;
  256.  
  257.    DBF =  OBJECT     {The main, and only, object.}
  258.        DBFName     : FileName;
  259.        DBFile      : File;
  260.        Header      : HeadPtr;
  261.        Fields      : FieldPtr;
  262.        Positions   : ^DBEditArray;
  263.        DBFOpen     : BOOLEAN;
  264.        IndsOpen    : BOOLEAN;
  265.        Indexes     : NdxPtr;
  266.        DBRecord    : ^DBType;
  267.        DBRecNum    : LONGINT;
  268.        TotalRecs   : LONGINT;
  269.        NumFields   : BYTE;
  270.        MAlloc      : BOOLEAN;
  271.        Start,Stop  : INTEGER;
  272.        FUNCTION    Add(Field1,Field2 : Byte):string;VIRTUAL;
  273.        PROCEDURE   AddDBKey(NdxID : BYTE;KeyStr : DBKey);VIRTUAL;
  274.        PROCEDURE   AddDBRec;VIRTUAL;
  275.        FUNCTION    Allocated : BOOLEAN;
  276.        PROCEDURE   AppendBlank;VIRTUAL;
  277.        PROCEDURE   BailOut;VIRTUAL;
  278.        FUNCTION    BinSearch(FieldNo : BYTE;
  279.         Position : Integer;SearchKey : DBKey) : LONGINT;
  280.        FUNCTION    BOF : Boolean;VIRTUAL;
  281.        PROCEDURE   CloseDBIndex(NdxID : BYTE);VIRTUAL;
  282.        PROCEDURE   DBReset;VIRTUAL;
  283.        PROCEDURE   DelDBKey(KeyStr : DBKey;NdxID : BYTE);VIRTUAL;
  284.        FUNCTION    Deleted : Boolean;VIRTUAL;
  285.        PROCEDURE   Display;VIRTUAL;
  286.        FUNCTION    Divide(Field1,Field2 : Byte):string;VIRTUAL;
  287.        DESTRUCTOR  Done;VIRTUAL;
  288.        FUNCTION    DBEOF : BOOLEAN;VIRTUAL;
  289.        FUNCTION    Field(FNo : Byte) : string;VIRTUAL;
  290.        PROCEDURE   FillRecs(NumRecs : LongInt);VIRTUAL;
  291.        PROCEDURE   Find(NdxID : BYTE;SearchStr : string);VIRTUAL;
  292.        PROCEDURE   FlushDB;VIRTUAL;
  293.        PROCEDURE   Get(FNo,X,Y : Byte);VIRTUAL;
  294.        PROCEDURE   GetDBRec(RecordNumber : LongInt);VIRTUAL;
  295.        FUNCTION    GetField(RecordNo : LongInt;FNo : Byte) : String;VIRTUAL;
  296.        PROCEDURE   GoBottom;VIRTUAL;
  297.        PROCEDURE   GoTop;VIRTUAL;
  298.        FUNCTION    IIF(BoolVAR : Boolean;IfTRUE,IfFALSE : String) : String;VIRTUAL;
  299.        PROCEDURE   IndexOn(NdxID : BYTE;NdxName : FileName;
  300.                         NdxField : BYTE;DupFlag : BYTE);
  301.        CONSTRUCTOR Init(DBName : FileName);
  302.        FUNCTION    LastRec : LONGINT;
  303.        FUNCTION    Locate(FieldNo : BYTE;SearchStr : String) : BOOLEAN;
  304.        PROCEDURE   LookUp(SearchStr : string;NdxID : BYTE);VIRTUAL;
  305.        PROCEDURE   MakeDBIndex(NdxID : BYTE;DBIndexName : FileName;KeyLen,Status : Integer);VIRTUAL;
  306.        PROCEDURE   Mark;VIRTUAL;
  307.        FUNCTION    Mul(Field1,Field2 : Byte):string;VIRTUAL;
  308.        PROCEDURE   NextDBKey(NdxID : BYTE;KeyStr : DBKey);VIRTUAL;
  309.        PROCEDURE   NewDBRec;VIRTUAL;
  310.        PROCEDURE   NextRec;VIRTUAL;
  311.        PROCEDURE   OpenDBIndex(NdxID : BYTE;DBIndexName : FileName;KeyLen,Status : Integer);VIRTUAL;
  312.        PROCEDURE   Pack;VIRTUAL;
  313.        PROCEDURE   PrevDBKey(NdxID : BYTE;KeyStr : DBKey);VIRTUAL;
  314.        PROCEDURE   PrevRec;VIRTUAL;
  315.        PROCEDURE   PutDBRec(RecordNumber : LongInt);VIRTUAL;
  316.        PROCEDURE   ReadDBHeader;VIRTUAL;
  317.        PROCEDURE   Recall;VIRTUAL;
  318.        FUNCTION    RecCount : LONGINT;VIRTUAL;
  319.        FUNCTION    RecNo : LONGINT;VIRTUAL;
  320.        PROCEDURE   Repl(FNo : Byte;InStr : string);VIRTUAL;
  321.        PROCEDURE   ReplEach(FNo : Byte;InStr : String);VIRTUAL;
  322.        PROCEDURE   Save;VIRTUAL;
  323.        PROCEDURE   Say(FNo,Row,Col : Byte);VIRTUAL;
  324.        PROCEDURE   ShowStatus;VIRTUAL;
  325.        PROCEDURE   Skip;VIRTUAL;
  326.        FUNCTION    Sub(Field1,Field2 : Byte) : string;VIRTUAL;
  327.        FUNCTION    Sum(FNo : Byte) : Real;VIRTUAL;
  328.        PROCEDURE   WriteDBHeader;VIRTUAL;
  329.        PROCEDURE   Zap;VIRTUAL;
  330.        END;
  331.  
  332. (****************************************************************************)
  333. (*          END Object Declaration                                          *)
  334. (****************************************************************************)
  335.  
  336. Const
  337.  
  338.         Up   : CharSet = [CursorUp];
  339.         Down : CharSet = [CursorDown,Return];
  340.         Next : CharSet = [Escape];
  341.  
  342. VAR
  343.         FilesOpen : BYTE;
  344.         UCKey : BOOLEAN;
  345.         ErrCode : INTEGER;
  346.         Found : BOOLEAN;
  347.         Ch,BC : CHAR;
  348.         Normal,Reverse : BYTE;
  349.         Decimals : Byte;
  350.         TempFile : File;
  351.         K : Byte;
  352.         NumLen : Byte;
  353.         Y,M,D,DW : WORD;
  354.         FromPack : BOOLEAN;
  355.         DateFormat : BYTE;
  356.  
  357. (**********************************)
  358. (*   PROCEDUREs and FUNCTIONs     *)
  359. (**********************************)
  360.  
  361. PROCEDURE Beep;
  362. {Sound a couple of tones.}
  363.  
  364. FUNCTION BoolToStr(Param : Byte;IfTRUE,IfFALSE : Char): String;
  365.  
  366.  
  367. PROCEDURE CheckScreen(VAR CurrPos:Byte;BC:Char;Up,Down:CharSet;Low,High:Byte);
  368. {Used in full screen editing.}
  369.  
  370. PROCEDURE CopyFile(Source,Dest : FileName);
  371.  
  372. PROCEDURE FlashFill(Row,Col,Rows,Cols,Attr : Byte;Ch : Char);
  373. {Fill a region of the screen with a specified color and character.}
  374.  
  375. FUNCTION GetBoolean(VAR Param:Byte;IfTRUE,IfFALSE:Char;X,Y:Byte):Char;
  376.  
  377. FUNCTION GetByte(VAR Param:Byte;LowLim,UpLim,Len,X,Y:Byte):Char;
  378.  
  379. FUNCTION GetInteger(VAR Param:Integer;LowLim,UpLim:Integer;Len,X,Y:Byte):Char;
  380. {Input an integer.}
  381.  
  382. FUNCTION GetLongInt(VAR Param:LongInt;LowLim,UpLim:LongInt;Len,X,Y:Byte):Char;
  383. {Input a long integer.}
  384.  
  385. FUNCTION GetReal(VAR Param : Real; LowLim, UpLim : Real; Len, X, Y : Word) : Char;
  386. {Input a real number.}
  387.  
  388. FUNCTION GetString(VAR Param : String; Len, X, Y : Byte) : Char;
  389. {Input a string.}
  390.  
  391. FUNCTION Input(VAR S:String;Term:CharSet;L,X,Y:Byte;VAR BC:Char):String;
  392.  
  393. FUNCTION IntToStr(Number : LongInt): String;
  394.  
  395. FUNCTION Max(N1,N2 : Integer) : Integer;
  396.  
  397. FUNCTION Min(N1,N2 : Integer) : Integer;
  398.  
  399. PROCEDURE Prompt(Row,Col : Byte;PromptStr : Str80);
  400. {Display a prompt at a specified row and column.}
  401.  
  402. FUNCTION ReadChar : Char;
  403.  
  404. PROCEDURE ReadKB (VAR ExtKey: Boolean; VAR Ch: Char);
  405.  
  406. FUNCTION RealToStr(Number : Real): String;
  407.  
  408. PROCEDURE SetDateFormat(Format : BYTE);
  409.  
  410. PROCEDURE SetDBColor(FG,BG : Byte);
  411. {Set initial foreground and background colors.}
  412.  
  413. PROCEDURE Wait;
  414. {Wait for a key press and display a message.}
  415.  
  416.         (************************************************************)
  417.         (*  Documentation for Procedures and Functions in TPDB.tpu  *)
  418.         (************************************************************)
  419.  
  420.             Add function
  421.  
  422.             Function
  423.  
  424.                         Adds two numeric fields
  425.  
  426.             Syntax
  427.  
  428.                         Add(Field1,Field2 : Byte);
  429.  
  430.             Remarks
  431.  
  432.                         Field1 and Field2 are the order numbers of the
  433.                         respective fields  as they appear  in the .DBF
  434.                         structure.
  435.  
  436.             *************************
  437.  
  438.             AddDBKey procedure
  439.  
  440.             Function Adds a key string  to the index currently in
  441.             use.
  442.  
  443.             Syntax
  444.                          AddDBKey(NdxID : BYTE;KeyStr : DBKey);
  445.  
  446.             Remarks
  447.  
  448.                          KeyStr  is  any  string  not  longer than 254
  449.                          characters.  A field  must be  converted to a
  450.                          string  by  using   the  Field  function
  451.                          (q.v.).
  452.  
  453.                          NdxID is the index ID number.
  454.  
  455.             Restrictions
  456.  
  457.                          Length(KeyStr) must be in the range of 1..254
  458.                          characters. All expressions  must evaluate to
  459.                          a single string not  more than 254 characters
  460.                          in length.
  461.  
  462.  
  463.             *************************
  464.  
  465.             AddDBRec procedure
  466.  
  467.             Function
  468.  
  469.                         Adds a new record to the .DBF file in use.
  470.  
  471.             Syntax
  472.  
  473.                         AddDBRec;
  474.  
  475.             Remarks
  476.  
  477.                         A new record must first be created with a call
  478.                         to the NewDBRec procedure.
  479.  
  480.             ************************
  481.  
  482.             AppendBlank procedure
  483.  
  484.             Function
  485.  
  486.                        Appends  a  new  blank  record  to  the current
  487.                        database file.
  488.  
  489.             Syntax
  490.  
  491.                        AppendBlank;
  492.  
  493.             ***********************
  494.  
  495.             BinSearch function
  496.  
  497.             Function
  498.  
  499.                        Performs  a  binary  search  on  a  sorted
  500.                        database,  searching for  s specified  key
  501.                        string in a specified field, starting from
  502.                        a  specific  position  within  the  field.
  503.             Syntax
  504.  
  505.                        BinSearch(FieldNo : BYTE;Position : Integer;
  506.                         SearchKey : DBKey) : LONGINT;
  507.  
  508.             ***********************
  509.  
  510.             BlockCursor procedure
  511.  
  512.             Function
  513.  
  514.                         Turns on a block cursor.
  515.  
  516.             Syntax
  517.  
  518.                         BlockCursor;
  519.  
  520.             ************************
  521.  
  522.             BOF function
  523.  
  524.             Function
  525.  
  526.                         Returns  beginning of  file status  of a  .DBF
  527.                         file.
  528.  
  529.             Syntax
  530.  
  531.                         BOF
  532.  
  533.             Result Type
  534.  
  535.                         Boolean
  536.  
  537.  
  538.  
  539.             ************************
  540.  
  541.             CalcDate function
  542.  
  543.             Function
  544.  
  545.                         Add or subtract days,months, or years from two
  546.                         dates.
  547.  
  548.             Syntax
  549.  
  550.                         CalcDate(InDate:DateStr;Days,Months,Years:
  551.                         integer): DateStr;
  552.  
  553.             *************************
  554.  
  555.             CDOW function
  556.  
  557.             Function
  558.  
  559.                         Returns   character   day   of   week  -  i.e.
  560.                         'Monday','Tuesday',etc.
  561.  
  562.             Syntax
  563.  
  564.                         CDOW(InDate : DateStr): DayStr;
  565.  
  566.             *************************
  567.  
  568.             CMonth function
  569.  
  570.             Function
  571.  
  572.                         Returns character month - i.e. 'March'
  573.  
  574.             Syntax
  575.  
  576.                         CMonth(InDate : DateStr) : Str9;
  577.  
  578.             *************************
  579.  
  580.             ChAttr procedure
  581.  
  582.             Function
  583.  
  584.                         Changes   the  display   attribute  of  a
  585.                         specified  number  of   characters  on  a
  586.                         specified line.
  587.  
  588.             Syntax
  589.  
  590.                         ChAttr(Number : Word; Row, Col, Attr : Word);
  591.  
  592.             Remarks
  593.  
  594.                         This procedure is contained in ATTR.obj.
  595.  
  596.            **************************
  597.  
  598.            ChAllAttr procedure
  599.  
  600.            Function
  601.  
  602.                         Changes   the  display   attribute  of  a
  603.                         specified screen block.
  604.  
  605.  
  606.            Syntax
  607.  
  608.                         ChAllAttr(Row,Col,Rows,Cols,Attr : Word);
  609.  
  610.            **************************
  611.  
  612.             CheckScreen procedure
  613.  
  614.             Function
  615.  
  616.                         Checks the current  field being edited against
  617.                         minimum   and   maximum   limits   of   fields
  618.                         displayed.
  619.                                      K
  620.             Syntax
  621.  
  622.                         CheckScreen(VarCurrPos:Byte;BC:Char;Up,Down:CharSet;
  623.                         Low,High:Byte);
  624.  
  625.             Remarks
  626.  
  627.                         CurrPos is  the number of  the field currently
  628.                         being edited in the editing loop (see DEMO.pas
  629.                         for an example).
  630.  
  631.                         BC  is  the  terminating  character when field
  632.                         editing has been completed.
  633.  
  634.                         Up  and  Down  are  the  character  sets which
  635.                         contain the terminating characters which allow
  636.                         you to  move from one field  to another, up or
  637.                         down. In TPDB, they  are declred as constants,
  638.                         as follows:
  639.  
  640.                                 Up : CharSet = [CursorUp]; Down :
  641.                                 CharSet = [CursorDown,Return];
  642.  
  643.  
  644.                         Low and  High are the low  and high numbers of
  645.                         the displayed fields.
  646.  
  647.             ************************
  648.  
  649.             CloseDBFile procedure
  650.  
  651.             Function
  652.  
  653.                         Closes the currently open .DBF file.
  654.  
  655.             Syntax
  656.  
  657.                         CloseDBFile;
  658.  
  659.             Remarks
  660.  
  661.                         This procedure is error-checked.
  662.  
  663.             ************************
  664.  
  665.             CloseDBIndex procedure
  666.  
  667.             Function
  668.  
  669.                         Closes the index currently in use.
  670.  
  671.             Syntax
  672.  
  673.                         CloseDBIndex(NdxID : BYTE);
  674.  
  675.             Remarks
  676.  
  677.                         NdxID is a number  assigned to the index. This
  678.                         procedure is error-checked.
  679.  
  680.             ************************
  681.  
  682.             CompDates function
  683.  
  684.             Function
  685.  
  686.                         Compares two  dates and calculates  the number
  687.                         of days between them.
  688.  
  689.             Syntax
  690.  
  691.                         CompDates(Date1,Date2 : DateStr):Word;
  692.  
  693.             *************************
  694.  
  695.             CTOD function
  696.  
  697.             Function
  698.  
  699.                         Converts  a .DBF  compatible date  field to  a
  700.                         word date type for date arithmetic.
  701.  
  702.             Syntax
  703.  
  704.                         CTOD(InDate: DateStr) : DateType;
  705.  
  706.             *************************
  707.  
  708.             CursorOn and CursorOff procedures
  709.  
  710.             Function
  711.  
  712.                         Turn cursor on and off
  713.  
  714.             Syntax
  715.  
  716.                         CursorOn; CursorOff;
  717.  
  718.                         Externally declared in Flash.obj.
  719.  
  720.             *************************
  721.  
  722.  
  723.             DBReset procedure
  724.  
  725.             Function
  726.  
  727.                         Resets a .DBF file, moving the file pointer to
  728.                         record 1.
  729.  
  730.             Syntax
  731.  
  732.                         DBReset;
  733.  
  734.             Remarks
  735.  
  736.                         This procedure is error-checked.
  737.  
  738.             ************************
  739.  
  740.             DelDBKey procedure
  741.  
  742.             Function
  743.  
  744.                         Deletes a key string in the index currently in
  745.                         use.
  746.  
  747.             Syntax
  748.  
  749.                         DelDBKey(KeyStr : DBKey;NdxID : BYTE);
  750.  
  751.             Remarks
  752.  
  753.                          See documentation for AddDBKey procedure.
  754.  
  755.  
  756.  
  757.             *************************
  758.  
  759.  
  760.             Deleted function
  761.  
  762.             Function
  763.  
  764.                         Returns  True if  the curent  record has  been
  765.                         marked for deletion, False  if it has not been
  766.                         marked.
  767.  
  768.             Syntax
  769.  
  770.                         Deleted : boolean;
  771.  
  772.  
  773.             ************************
  774.  
  775.             Display procedure
  776.  
  777.             Function
  778.  
  779.                         Displays  the  current  record  in a partially
  780.                         formatted manner.
  781.  
  782.             Syntax
  783.  
  784.                         Display;
  785.  
  786.             Remarks
  787.  
  788.                         Date fields are formatted as MM/DD/YY.
  789.  
  790.             *************************
  791.  
  792.             Divide function
  793.  
  794.             Function
  795.  
  796.                         Divides field1 BY field2
  797.  
  798.             Syntax
  799.  
  800.                         Divide(Field1,Field2 : Byte):string;
  801.  
  802.             Remarks
  803.  
  804.                         Field1 and Field2 are the order numbers of the
  805.                         respective fields  as they appear  in the .DBF
  806.                         structure.
  807.  
  808.             *************************
  809.  
  810.             Done DESTRUCTOR
  811.  
  812.             This  destructor MUST  be called  when closing  a database
  813.             file. Calling this procedure closes all associated indexes
  814.             at the same time.
  815.  
  816.             Syntax
  817.             VAR
  818.                Example : DataObject;
  819.  
  820.                         DISPOSE(Example^,Done);
  821.  
  822.  
  823.             *************************
  824.  
  825.             DTOC function
  826.  
  827.             Function
  828.  
  829.                         Converts  a   word  date  type   to  a  string
  830.                         compatible with .DBF date fields.
  831.  
  832.             Syntax
  833.  
  834.                         DTOC(Julian: DateType) : DateStr;
  835.  
  836.             *************************
  837.  
  838.             EOF function
  839.  
  840.             Function
  841.  
  842.                         Returns end-of-file status of a .DBF file.
  843.  
  844.             Syntax
  845.  
  846.                         EOF
  847.  
  848.             Return Type
  849.  
  850.                         Boolean
  851.  
  852.             ************************
  853.  
  854.             Field function
  855.  
  856.             Function
  857.  
  858.                         Returns the string value  of a specified field
  859.                         in a specified record in a .DBF file.
  860.  
  861.             Syntax
  862.  
  863.                         Field(FNo : Byte) : string;
  864.  
  865.             Remarks
  866.  
  867.                         FNo  is the  number of  the field  in the .DBF
  868.                         file structure. Date fields are not formatted.
  869.  
  870.             ************************
  871.  
  872.             FillRecs procedure
  873.  
  874.             Function
  875.  
  876.                         Appends a specified number of blank records to
  877.                         a .DBF file.
  878.  
  879.             Syntax
  880.  
  881.                         FillRecs(NumRecs : LongInt);
  882.  
  883.             ************************
  884.  
  885.             Find procedure
  886.  
  887.             Function
  888.  
  889.                         Searches  for a  string in  the currently open
  890.                         index.
  891.  
  892.             Syntax
  893.  
  894.                         Find(NdxID : BYTE;SearchStr : string);
  895.  
  896.             Remarks
  897.                          NdxID  is  the  ID  number  assigned  to  the
  898.                          current  index.  If  the  string  is found, a
  899.                          value  of  True  is  returned  in  the global
  900.                          boolean variable Found. If  the string is not
  901.                          found, a value of False is returned in Found.
  902.  
  903.             ************************
  904.  
  905.             Flash procedure
  906.  
  907.             Function
  908.  
  909.                         Writes a string at a specified row and column,
  910.                         using a  specified attribute, by  direct video
  911.                         access.
  912.  
  913.             Syntax
  914.  
  915.                         Flash(Row,Col, Attr:byte; Str : String);
  916.  
  917.             Remarks
  918.  
  919.                         When  setting attribute,  constant folding can
  920.                         be  used.  See   color  constants  in  globals
  921.                         section.
  922.  
  923.             ************************
  924.  
  925.             FlashC procedure
  926.  
  927.             Function
  928.  
  929.                         Writes a  centered string at  a specified row,
  930.                         using a  specified attribute, by  direct video
  931.                         access.
  932.  
  933.             Syntax
  934.  
  935.                         FlashC(Row,Attr:Byte;Str : String);
  936.  
  937.             Remarks
  938.  
  939.                         See remarks for Flash procedure.
  940.  
  941.             ************************
  942.  
  943.             FlashFill procedure
  944.  
  945.             Function
  946.  
  947.                         Fills   a  specified   screen  block   with  a
  948.                         specified character and attribute.
  949.  
  950.             Syntax
  951.  
  952.                         FlashFill(Row,Col,Rows,Cols,Attr        :
  953.                         Byte;Ch : Char);
  954.  
  955.             Remarks
  956.  
  957.                         See remarks for other Flash procedures.
  958.  
  959.             ************************
  960.  
  961.  
  962.             FlushDB procedure
  963.  
  964.             Function
  965.  
  966.                         Flushes  records currently  in memory  to disk
  967.                         file.
  968.  
  969.             Syntax
  970.  
  971.                         FlushDB;
  972.  
  973.             Remarks
  974.  
  975.                         This procedure is error-checked.
  976.  
  977.  
  978.             ************************
  979.  
  980.             FormDate function
  981.  
  982.             Function
  983.  
  984.                         Formats a date string as stored in a .DBF file
  985.                         in the 'MM/DD/YY' format.
  986.  
  987.             Syntax
  988.  
  989.                         FormDate(InDate:DateStr):String;
  990.  
  991.             *************************
  992.  
  993.             Get procedure
  994.  
  995.             Function
  996.  
  997.                         Edits  a  specified  field  in  the  .DBF at a
  998.                         specified row and column.
  999.  
  1000.             Syntax
  1001.  
  1002.                         Get(FieldNumber,Row,Col : Byte);
  1003.  
  1004.             Remarks
  1005.  
  1006.                         The following editing keys are active:
  1007.  
  1008.                         Left  cursor
  1009.                         Right  cursor
  1010.                         Home
  1011.                         End
  1012.                         Backspace
  1013.                         Delete
  1014.                         Ctrl-Y (Deletes the entire field.)
  1015.  
  1016.  
  1017.             ************************
  1018.  
  1019.             GetDBRec procedure
  1020.  
  1021.             Function
  1022.  
  1023.                         Locates and reads a specified record in a .DBF
  1024.                         file.
  1025.  
  1026.             Syntax
  1027.  
  1028.                         GetDBRec(RecordNumber : LongInt);
  1029.  
  1030.             ************************
  1031.  
  1032.  
  1033.             GetString procedure
  1034.  
  1035.             Function
  1036.  
  1037.                         Allows  screen  input  of  a  string,  as in a
  1038.                         search procedure.
  1039.  
  1040.             Syntax
  1041.  
  1042.                         GetString(Var Parameter : String; Length,
  1043.                         Row, Col : Byte) : Char;
  1044.  
  1045.             ************************
  1046.  
  1047.             GoBottom procedure
  1048.  
  1049.             Function
  1050.  
  1051.                         Set the file pointer at the end of file.
  1052.  
  1053.             Syntax
  1054.  
  1055.                         GoBottom;
  1056.  
  1057.             ************************
  1058.  
  1059.             GoTop procedure
  1060.  
  1061.             Function
  1062.  
  1063.                         Sets  the  file  pointer  at  the beginning of
  1064.                         file.
  1065.  
  1066.             Syntax
  1067.  
  1068.                         GoTop;
  1069.  
  1070.             ************************
  1071.  
  1072.  
  1073.             IIF function
  1074.  
  1075.             Function
  1076.  
  1077.                         Evaluates  a  boolean  variable  and returns a
  1078.                         string according to the value of the boolean.
  1079.  
  1080.             Syntax
  1081.  
  1082.                         IIF(BoolVar  :  Boolean;IfTrue,IfFalse  :
  1083.                         String) : String;
  1084.  
  1085.             ************************
  1086.  
  1087.             IndexOn procedure
  1088.  
  1089.             Function
  1090.  
  1091.                         Builds an index on a specified key field.
  1092.  
  1093.             Syntax
  1094.  
  1095.                         IndexOn(NdxID : BYTE;NdxName : FileName;
  1096.                           NdxField : BYTE;DupFlag : BYTE);
  1097.  
  1098.             Remarks
  1099.                         NdxID is an ID  number assigned to the current
  1100.                         index.  DupFlag  may  be  a  constant  such as
  1101.                         Duplicates or NoDuplicates.
  1102.  
  1103.             ************************
  1104.  
  1105.             Init CONSTRUCTOR
  1106.  
  1107.             Function
  1108.  
  1109.                         Initializes  a  data   object  and  opens  the
  1110.                         associated DBF file.
  1111.  
  1112.             Syntax
  1113.  
  1114.                         Init(DBName : FileName);
  1115.             VAR
  1116.                   Example : DataObject;
  1117.  
  1118.                         NEW(Example,Init('example.dbf'));
  1119.  
  1120.             ************************
  1121.  
  1122.             JustL function
  1123.  
  1124.             Function
  1125.  
  1126.                         Left   justifies   a   string   within  a
  1127.                         specified field length.
  1128.  
  1129.             Syntax
  1130.  
  1131.                         JustL(InString:     String;     FieldLen:
  1132.                         Integer): String;
  1133.  
  1134.             ************************
  1135.  
  1136.             LTrim function
  1137.  
  1138.             Function
  1139.  
  1140.                         Trims leading spaces from a string.
  1141.  
  1142.             Syntax
  1143.  
  1144.                         LTrim(InStr: String): String;
  1145.  
  1146.             *************************
  1147.  
  1148.             Locate procedure
  1149.  
  1150.             Function
  1151.  
  1152.                         Searches sequentially through a DBF file for a
  1153.                         specified search string, stopping at the first
  1154.                         record  which  matches  the  search condition.
  1155.  
  1156.             Syntax
  1157.                         Locate(FieldNo  : BYTE;SearchStr  : String)  :
  1158.                         BOOLEAN;
  1159.  
  1160.             ************************
  1161.  
  1162.             LookUp procedure
  1163.  
  1164.             Function
  1165.  
  1166.                        Searches for a key string in an index, and sets
  1167.                        the record pointer at the record containing the
  1168.                        closest match.
  1169.  
  1170.            Syntax
  1171.  
  1172.                        LookUp(SearchStr : string;NdxID: BYTE);
  1173.  
  1174.            ************************
  1175.  
  1176.             Lower function
  1177.  
  1178.             Function
  1179.  
  1180.                         Converts a string to lower case.
  1181.  
  1182.             Syntax
  1183.  
  1184.                         Lower(InStr: String):  String; Externally
  1185.                         declared in Flash.obj.
  1186.  
  1187.             *************************
  1188.  
  1189.             MakeDBIndex procedure
  1190.  
  1191.             Function
  1192.  
  1193.                         Creates  a new  index file  but does  not
  1194.                         build it.
  1195.  
  1196.             Syntax
  1197.                         MakeDBIndex(NdxID    :    BYTE;DBIndexName   :
  1198.                               FileName;KeyLen,Status : Integer);
  1199.  
  1200.             Remarks
  1201.  
  1202.                         DBIndexName can be a  maximum of 66 chars
  1203.                         in length  and is the full  path and name
  1204.                         of the index file  to be created. the key
  1205.                         field.
  1206.  
  1207.                         KeyLen  is the  length of  the key field.
  1208.                         Number  are  stored  as  strings  in .DBF
  1209.                         files,  and  can  thus  be  used  as keys
  1210.                         without conversion.
  1211.  
  1212.                         Status   is   defined   as   one  of  two
  1213.                         constants:  NoDuplicates,  or Duplicates,
  1214.                         according  to  whether  or  not duplicate
  1215.                         keys will be allowed in the index.
  1216.  
  1217.  
  1218.             ************************
  1219.  
  1220.             Mark procedure
  1221.  
  1222.             Function
  1223.  
  1224.                         Marks the current record for deletion.
  1225.  
  1226.             Syntax
  1227.  
  1228.                         Mark;
  1229.  
  1230.  
  1231.             ************************
  1232.  
  1233.             Max function
  1234.  
  1235.             Function
  1236.  
  1237.                         Determines the maximum of two integers
  1238.  
  1239.             Syntax
  1240.  
  1241.                         Max(N1,N2 : Integer) : Integer;
  1242.  
  1243.             *************************
  1244.  
  1245.             Min function
  1246.  
  1247.             Function
  1248.  
  1249.                         Determines the minimum of two integers
  1250.  
  1251.             Syntax
  1252.  
  1253.                         Min(N1,N2 : Integer) : Integer;
  1254.  
  1255.             *************************
  1256.  
  1257.             Mon function
  1258.  
  1259.             Function
  1260.  
  1261.                         Returns numeric value for  the month in a
  1262.                         date.
  1263.  
  1264.             Syntax
  1265.  
  1266.                         Mon(InDate : DateStr) : Byte;
  1267.  
  1268.             *************************
  1269.  
  1270.             Mul function
  1271.  
  1272.             Function
  1273.  
  1274.                         Multiplies two numeric fields.
  1275.  
  1276.             Syntax
  1277.  
  1278.                         Mul(Field1,Field2 : Byte):string;
  1279.  
  1280.             Remarks
  1281.  
  1282.                         Field1 and  Field2 are the  order numbers
  1283.                         of the  respective fields as  they appear
  1284.                         in the .DBF structure.
  1285.  
  1286.             *************************
  1287.  
  1288.             NewDBRec procedure
  1289.  
  1290.             Function
  1291.  
  1292.                         Creates  a  new  blank  record in memory,
  1293.                         ready for editing.
  1294.  
  1295.             Syntax
  1296.  
  1297.                         NewDBRec;
  1298.  
  1299.             ************************
  1300.  
  1301.             NextDBKey procedure
  1302.  
  1303.             Function
  1304.  
  1305.                         Moves file  record pointer to  the record
  1306.                         number associated with the next key in an
  1307.                         index.
  1308.  
  1309.             Syntax
  1310.  
  1311.                         NextDBKey(NdxID : BYTE;KeyStr : DBKey);
  1312.  
  1313.             Remarks
  1314.  
  1315.                          See    documentation     for    AddDBKey
  1316.                          procedure.
  1317.  
  1318.  
  1319.             ************************
  1320.  
  1321.             NextRec procedure
  1322.  
  1323.             Function
  1324.  
  1325.                         Moves  the  file   pointer  to  the  next
  1326.                         sequential record in the file.
  1327.  
  1328.             Syntax
  1329.  
  1330.                         NextRec;
  1331.  
  1332.             ************************
  1333.  
  1334.             OpenDBIndex procedure
  1335.  
  1336.             Function
  1337.  
  1338.                         Opens an index for search and updating.
  1339.  
  1340.             Syntax
  1341.  
  1342.                         OpenDBIndex(NdxID    :    BYTE;DBIndexName   :
  1343.                         FileName;KeyLen,Status : Integer);
  1344.  
  1345.             Remarks
  1346.  
  1347.                         DBIndexName can be a  maximum of 66 chars
  1348.                         in length  and is the full  path and name
  1349.                         of the index file  to be created. the key
  1350.                         field.
  1351.  
  1352.                         KeyLen  is the  length of  the key field.
  1353.                         Number  are  stored  as  strings  in .DBF
  1354.                         files,  and  can  thus  be  used  as keys
  1355.                         without conversion.
  1356.  
  1357.                         Status   is   defined   as   one  of  two
  1358.                         constants:  NoDuplicates,  or Duplicates,
  1359.                         according  to  whether  or  not duplicate
  1360.                         keys will be allowed in the index.
  1361.  
  1362.  
  1363.             ************************
  1364.  
  1365.             Pack procedure
  1366.  
  1367.             Function
  1368.  
  1369.                         Packs  a  .DBF  files,  removing  records
  1370.                         marked for deletion.
  1371.  
  1372.             Syntax
  1373.  
  1374.                         Pack;
  1375.  
  1376.             ************************
  1377.  
  1378.             PadL function
  1379.  
  1380.             Function
  1381.  
  1382.                         Pads a string with spaces on the left, to
  1383.                         a specified field length.
  1384.  
  1385.             Syntax
  1386.  
  1387.                         PadL(InStr:      String;     FieldLength:
  1388.                         Integer): String;
  1389.  
  1390.             ************************
  1391.  
  1392.             PadR function
  1393.  
  1394.             Function
  1395.  
  1396.                         Pads a  string with spaces  on the right,
  1397.                         to a specified field length.
  1398.  
  1399.             Syntax
  1400.  
  1401.                         PadR(InStr:      String;     FieldLength:
  1402.                         Integer): String;
  1403.  
  1404.  
  1405.             ************************
  1406.  
  1407.             PrevDBKey procedure
  1408.  
  1409.             Function
  1410.  
  1411.                         Moves file  pointer to the  record number
  1412.                         corresponding to  the previous key  in an
  1413.                         index.
  1414.  
  1415.             Syntax
  1416.  
  1417.                         PrevDBKey(NdxID : BYTE;KeyStr : DBKey);
  1418.  
  1419.             Remarks
  1420.  
  1421.                         See documentation for AddDBKey procedure.
  1422.  
  1423.  
  1424.             ************************
  1425.  
  1426.             PrevRec procedure
  1427.  
  1428.             Function
  1429.  
  1430.                         Moves  the file  pointer to  the previous
  1431.                         sequemtial record in the file.
  1432.  
  1433.             Syntax
  1434.  
  1435.                         PrevRec;
  1436.  
  1437.             ************************
  1438.  
  1439.             Prompt procedure
  1440.  
  1441.             Function
  1442.  
  1443.                         Displays a  prompt string at  a specified
  1444.                         row an column, using direct video writes.
  1445.  
  1446.             Syntax
  1447.  
  1448.                         Prompt(Row,Col : Byte;PromptStr : Str80);
  1449.  
  1450.             ************************
  1451.  
  1452.             PutDBRec procedure
  1453.  
  1454.             Function
  1455.  
  1456.                         Writes  the current  editing record  to a
  1457.                         specified record number in the .DBF file.
  1458.  
  1459.             Syntax
  1460.  
  1461.                         PutDBRec(RecordNumber : LongInt);
  1462.  
  1463.             Remarks
  1464.  
  1465.                         Be sure that  the specified record number
  1466.                         is the same as the  one given in the call
  1467.                         to GetDBRec.
  1468.  
  1469.             ************************
  1470.  
  1471.  
  1472.             ReadDBHeader procedure
  1473.  
  1474.             Function
  1475.  
  1476.                         Reads the file header of a .DBF file into
  1477.                         a buffer.
  1478.  
  1479.             Syntax
  1480.  
  1481.                         ReadDBHeader;
  1482.  
  1483.             ************************
  1484.  
  1485.             Recall procedure
  1486.  
  1487.             Function
  1488.  
  1489.                         Unmarks  a record  previously marked  for
  1490.                         deletion.
  1491.  
  1492.             Syntax
  1493.  
  1494.                         Recall;
  1495.  
  1496.             ************************
  1497.  
  1498.             Repl procedure
  1499.  
  1500.             Function
  1501.  
  1502.                         Replaces  a specified  field in  a record
  1503.                         with a specified string.
  1504.  
  1505.             Syntax
  1506.  
  1507.                         Repl(FieldNumber    :    Byte;ReplStr   :
  1508.                         string);
  1509.  
  1510.             Remarks
  1511.  
  1512.                         FieldNumber is the number of the field in
  1513.                         the .DBF  file structure. ReplStr  is the
  1514.                         string  with  which  the  field  is to be
  1515.                         replaced.  When  replacing  date  fields,
  1516.                         remember that the date  string must be in
  1517.                         the form "19890214".
  1518.  
  1519.             ************************
  1520.  
  1521.             ReplEach procedure
  1522.  
  1523.             Function
  1524.  
  1525.                         Replaces a specified field in each record
  1526.                         in a .DBF file with a specified string.
  1527.  
  1528.             Syntax
  1529.  
  1530.                         ReplEach(FieldNumber  :   Byte;ReplStr  :
  1531.                         String);
  1532.  
  1533.             Remarks
  1534.  
  1535.                         FieldNumber is the number of the field in
  1536.                         the .DBF  file structure. ReplStr  is the
  1537.                         string  with  which  the  field  is to be
  1538.                         replaced.  When  replacing  date  fields,
  1539.                         remember that the date  string must be in
  1540.                         the form "19890214".
  1541.  
  1542.             ************************
  1543.  
  1544.             Replicate function
  1545.  
  1546.             Function
  1547.  
  1548.                         Fills a string with a specified number of
  1549.                         a specified character.
  1550.  
  1551.             Syntax
  1552.  
  1553.                         Replicate(Ch  :  Char;Count   :  word)  :
  1554.                         String; Externally declared in Flash.obj.
  1555.  
  1556.             ************************
  1557.  
  1558.             RTrim function
  1559.  
  1560.             Function
  1561.  
  1562.                         Trims trailing blanks from a string.
  1563.  
  1564.             Syntax
  1565.  
  1566.                         RTrim(InStr: String): String;
  1567.  
  1568.             ************************
  1569.  
  1570.             Save procedure
  1571.  
  1572.             Function
  1573.  
  1574.                         Writes the current record to disk.
  1575.  
  1576.  
  1577.             Syntax
  1578.  
  1579.                         Save;
  1580.  
  1581.             ***********************
  1582.  
  1583.             Say procedure
  1584.  
  1585.             Function
  1586.  
  1587.                         Displays   a   particular   field   at  a
  1588.                         specified row and column.
  1589.  
  1590.             Syntax
  1591.  
  1592.                         Say(FieldNumber,Row,Col : Byte);
  1593.  
  1594.             Remarks
  1595.  
  1596.                         FieldNumber is the  position of the field
  1597.                         in the .DBF file structure.
  1598.  
  1599.             ************************
  1600.  
  1601.             SetDBColor
  1602.  
  1603.             Function
  1604.  
  1605.                         Sets  foreground   and  background  color
  1606.                         before a call to ClrScr.
  1607.  
  1608.             Syntax
  1609.  
  1610.                         SetDBColor(FG,BG : Byte);
  1611.  
  1612.             ************************
  1613.  
  1614.             SetDateFormat procedure
  1615.  
  1616.             Function
  1617.  
  1618.                         Sets date format to  one of the following
  1619.                         constants:
  1620.  
  1621.                         French   = 1; {dd/mm/yy}
  1622.                         German   = 2; {dd.mm.yy}
  1623.                         Italian  = 3; {dd-mm-yy}
  1624.                         American = 4; {mm/dd/yy}
  1625.                         British  = 5; {dd/mm/yy}
  1626.                         Ansi     = 99;{yy.mm.dd}
  1627.  
  1628.             Syntax
  1629.                         SetDateFormat(Format : Byte);
  1630.  
  1631.             Example
  1632.  
  1633.                         SetDateFormat(Ansi);
  1634.  
  1635.             ************************
  1636.  
  1637.             ShowStatus procedure
  1638.  
  1639.             Function
  1640.  
  1641.                         Displays  status  of  .DBF  file, after a
  1642.                         call to ReadDBHeader.
  1643.  
  1644.             Syntax
  1645.  
  1646.                         ShowStatus;
  1647.  
  1648.             ************************
  1649.  
  1650.             Skip procedure
  1651.  
  1652.             Function
  1653.  
  1654.                         Skips to the next sequential record in a DBF.
  1655.  
  1656.             Syntax
  1657.  
  1658.                         Skip;
  1659.  
  1660.             ************************
  1661.  
  1662.             SortOn procedure
  1663.  
  1664.             Function
  1665.  
  1666.                       Sorts a  DBF file to another  DBF, on a key
  1667.                       string expression  of up to  254 characters
  1668.                       in length.
  1669.  
  1670.                       See   SortDemo.pas  and   TPDBSort.pas  for
  1671.                       syntax and explanation.
  1672.  
  1673.             ***********************
  1674.  
  1675.             Sub function
  1676.  
  1677.             Function
  1678.  
  1679.                         Subtracts two numeric  fields - field2 is
  1680.                         subtracted FROM field1.
  1681.  
  1682.             Syntax
  1683.  
  1684.                         Sub(Field1,Field2 : Byte) : string;
  1685.  
  1686.             Remarks
  1687.  
  1688.                         Field1 and  Field2 are the  order numbers
  1689.                         of the  respective fields as  they appear
  1690.                         in the .DBF structure.
  1691.  
  1692.             *************************
  1693.  
  1694.             Sum function
  1695.  
  1696.             Function
  1697.  
  1698.                         Sums a numeric field  in all records in a
  1699.                         .DBF file.
  1700.  
  1701.             Syntax
  1702.  
  1703.                         Sum(FNo : Byte) : Real;
  1704.  
  1705.  
  1706.  
  1707.             ************************
  1708.  
  1709.             TimeNow function
  1710.  
  1711.             Function
  1712.  
  1713.                         Returns current time in formatted string.
  1714.  
  1715.             Syntax
  1716.  
  1717.                         TimeNow : TimeStr;
  1718.  
  1719.             *************************
  1720.  
  1721.             Today function
  1722.  
  1723.             Function
  1724.  
  1725.                         Returns current  date in .DBF  date field
  1726.                         compatible format.
  1727.  
  1728.             Syntax
  1729.  
  1730.                         Today : DateStr;
  1731.  
  1732.             *************************
  1733.  
  1734.             Upper function
  1735.  
  1736.             Function
  1737.  
  1738.                         Converts a string to upper case.
  1739.  
  1740.             Syntax
  1741.  
  1742.                         Upper(InStr:  String):  String; Externall
  1743.                         declared in Flash.obj.
  1744.  
  1745.             ************************
  1746.  
  1747.             ValidDate function
  1748.  
  1749.                         Checks  whether  a  date  is  valid,  and
  1750.                         returns True or False.
  1751.  
  1752.             Syntax
  1753.  
  1754.                         ValidDate(InDate : DateStr): boolean;
  1755.  
  1756.             *************************
  1757.  
  1758.             Wait procedure
  1759.  
  1760.             Function
  1761.  
  1762.                         Displays  a  prompt,  'Press  any  key to
  1763.                         continue...', and waits for a key press.
  1764.  
  1765.             Syntax
  1766.  
  1767.                         Wait;
  1768.  
  1769.             ************************
  1770.  
  1771.             WriteDBHeader procedure
  1772.  
  1773.             Function
  1774.  
  1775.                         Updates a .DBF file header.
  1776.  
  1777.             Syntax
  1778.  
  1779.                         WriteDBHeader;
  1780.  
  1781.  
  1782.             ************************
  1783.  
  1784.             Zap procedure
  1785.  
  1786.             Function
  1787.  
  1788.                         Deletes all records in a .DBF file.
  1789.  
  1790.             Syntax
  1791.  
  1792.                         Zap;
  1793.  
  1794.             Remarks
  1795.  
  1796.                         CAREFUL  !  This  procedure  really  does
  1797.                         remove all  records, completely rewriting
  1798.                         the file.
  1799.  
  1800.             ************************
  1801.  
  1802.             (**** Revision History ****)
  1803.  
  1804.             2/7/89 - Version 1.0 released
  1805.  
  1806.             2/8/89  - Version  1.1 -  fixed bug  in numeric input
  1807.             that caused truncation  of integers. Also, recompiled
  1808.             in  $N-,$E+  state  to  allow  for  8087 emulation on
  1809.             non-8087  machines.   Fixed  range  error   in  array
  1810.             indexing.
  1811.  
  1812.             Renamed unit TPDB10.tpu  to TPDB.tpu. Future versions
  1813.             will retain this name.
  1814.  
  1815.             2/10/89 - Version 1.2 - Modified indexing routines to
  1816.             allow for index keys up to 254 characters.
  1817.  
  1818.                 Added  boolean  variable,   UCKey,  which  allows
  1819.                 indexes to be created on upper case form of keys.
  1820.  
  1821.                 Added procedures Prompt and Upper.
  1822.  
  1823.                 Added procedures Flash, FlashC, and FlashFill.
  1824.  
  1825.                 Added CheckScreen procedure.
  1826.  
  1827.                 Expanded documentation and added demo files.
  1828.  
  1829.                 Temporarily  removed  source  code  from this doc
  1830.                 file  pending further  additions and  decision on
  1831.                 which source to include.
  1832.  
  1833.             2/14/89 - Version 1.3 - Added TPDB error handler.
  1834.  
  1835.                 Improved documentation.
  1836.  
  1837.                 Fixed bug in Display procedure.
  1838.  
  1839.                 Added Sum  and Field functions,  NextRec and
  1840.                 PrevRec procedures.
  1841.  
  1842.                 Added BOF and EOF functions.
  1843.  
  1844.                 Added PrevDBKey and NextDBKey procedures.
  1845.  
  1846.                 Added Repl and ReplEach procedures.
  1847.  
  1848.                 Added FillRecs procedure.
  1849.  
  1850.  
  1851.             2/22/89 - Version 2.0 - Modified indexing routines to
  1852.             allow key  expressions which evaluate to  a string to
  1853.             be passed to the indexing routines.
  1854.  
  1855.             Improved documentation.
  1856.  
  1857.             Added  new   assembler  string  and   video  handling
  1858.             procedures.
  1859.  
  1860.             Added source for TPDB.tpu.
  1861.  
  1862.             Added  TPDBDate.tpu  -  date  handling routines, with
  1863.             source.
  1864.  
  1865.             Added  TPDBMath.tpu  -  mathematical  functions, with
  1866.             source.
  1867.  
  1868.             Because of significant revisions and additions to the
  1869.             original  source,  released  this  version as version
  1870.             2.0.
  1871.  
  1872.             2/23/89 -  Version 2.1 - fixed  bug in array indexing
  1873.             in Display and Field procedures.
  1874.  
  1875.             3/1/89 -  Version 2.2 - modified  Repl and Field
  1876.             procedures to use Move procedure. Added TPDBHigh.pas,
  1877.             a unit  of high level  calls. Documentation for  high
  1878.             level  calls  is  contained  within  the source code.
  1879.  
  1880.             8/3/89  -  Version  3.0  -  Converted  to  object-oriented
  1881.             version. The number of DBF files  and NDX files per DBF is
  1882.             limited now only by the amount of available memory and the
  1883.             DOS  version in  use.  Procedures  and functions  added as
  1884.             documented above.
  1885.  
  1886.             8/19/89 - Version 3.1 -
  1887.  
  1888.             - Procedure SetColor changed to SetDBColor to prevent conflicts
  1889.               when the Graph unit is used.
  1890.  
  1891.             - Procedure  SetDateFormat was added to  allow use of
  1892.               foreign date formats.
  1893.  
  1894.               Supported date formats are as follows:
  1895.               CONST
  1896.               French   = 1; {dd/mm/yy}
  1897.               German   = 2; {dd.mm.yy}
  1898.               Italian  = 3; {dd-mm-yy}
  1899.               American = 4; {mm/dd/yy}
  1900.               British  = 5; {dd/mm/yy}
  1901.               Ansi     = 99;{yy.mm.dd}
  1902.  
  1903.            -  Added  procedures  ChAttr  and  ChAllAttr to change
  1904.               displayed screen  attributes.
  1905.  
  1906.            -  Added TPDBSort.tpu, containing Procedure SortOn.
  1907.  
  1908.            -  Added BinSearch routine, for searching sorted files of
  1909.               unique keys.
  1910.  
  1911.            - Version  3.11 - September,  1989 - moved  all string
  1912.              handling  functions into  TPDBStr.pas. Moved  most screen
  1913.              handling functions into TPDBScrn.pas.
  1914.  
  1915.             ********************************************************
  1916.                     End  of Documentation  - TPDB  Version 3.14
  1917.                               Copyright 1990 Brian Corll
  1918.             ********************************************************
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.